package com.lpc.kotlintest

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.view.View
import kotlinx.android.synthetic.main.activity_second.*
import org.jetbrains.anko.doAsync
import org.jetbrains.anko.startActivity
import org.jetbrains.anko.toast
import org.jetbrains.anko.uiThread

/**
 * 功能:
 *
 * 描述:
 *
 * Created by lipc0113 on 2018/7/23.
 */
class SecondActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_second)

        btn1.text = "123"

        btn1.setOnClickListener {
            toast("111")
            startActivity<SecondActivity>("11" to "111")
        }

    }

    fun click2(view: View) {

        doAsync {

            Thread.sleep(5000)
            uiThread {
                toast("uiThread")
            }
        }
    }

    fun click3(view: View) {

        toast("333")
    }
}

